<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
登录成功！<br>
<a href = "${pageContext.request.contextPath}/user.do?method=findAllUserList" method="post">查询用户信息</a>
<a href = "${pageContext.request.contextPath}/user.do?method=openAddUser" method="post">添加用户信息</a>
<a href = "${pageContext.request.contextPath}/role.do?method=findAllRoleInfo" method="post">查询角色信息</a>
<a href = "${pageContext.request.contextPath}/menu.do?method=openMenu" method="post">添加权限</a>
<a href = "${pageContext.request.contextPath}/menu.do?method=findAllMenuList">查看所有权限</a>
<a href = "${pageContext.request.contextPath}/user.do?method=findUserByPage&pageNum=1" method="post">分页查询</a>
<br>
<%-- <template v-for="(item, index) in menus">

	<template v-if="edit == item.menuName" >
	<a :href="baseUrl + item.menuUrl + '&userid=${role.roleId }&tgId=' + item.menuPid">{{item.menuName}}</a>
	</template>
	
	<template v-if="del == item.menuName" >
	<a :href="baseUrl + item.menuUrl + '&userid=${role.roleId }&tgId=' + item.menuPid">{{item.menuName}}</a>
	</template>
	
	</template> 
	<!-- vue 遍历菜单 -->
	<script type="text/javascript">
   
   
    	var _vm = new Vue({
    		el : "#menu",
    		data : {
    			baseUrl : '${pageContext.request.contextPath}',
    			menus : ${resultMenus},
    			add:"添加角色",
    			del:"删除角色",
    			edit:"修改角色"
    			
    			
    		}
    	});
        
    </script>--%>
<table border=1 cellpadding="10" cellspacing="0">
<tr>

<th>账号</th>
<th>姓名</th>
<th>密码</th>
<th>操作</th>
</tr>

<c:forEach items="${userList}" var="user">

<tr>
<th>${user.userId }</th> 
<th>${user.password }</th>
<th>${user.username}</th>
<th><a href = "${pageContext.request.contextPath}/user.do?method=openEditUser&userid=${user.userId}" >修改用户信息</a>
	<a href = "${pageContext.request.contextPath}/user.do?method=giveRoleToUser&userid=${user.userId}">赋予角色</a>
</th>

</tr>
</c:forEach>

</table>  

            
                <ul id="wrapper">
                    <template v-for="(item, index) in menuData">
	                      	<a href="#">{{ item.menu.menuName }}</a>
		                   <li v-for="(itm, idx) in item.items">
		                         <a class="J_menuItem" :href="'${pageContext.request.contextPath}' + itm.href + '&tgName=' + itm.menuName + '&tgId=' + itm.menuId" :data-href="'${pageContext.request.contextPath}' + itm.href" >{{itm.menuName}}</a>
		                   </li>		               	              
	                </template>
                </ul>
           
        
	<script src="${pageContext.request.contextPath}/static/js/vue.min.js"></script>
    
    <!-- vue 遍历菜单 -->
    <script type="text/javascript">
   		var _vm = new Vue({
   			el : "#wrapper",
   			data : {
   				iframeUrl : "",
   				menuShow : null,
   				menuText : "${permissionTip}",
   				menuData : [],
   				menuTemp : ${menuTree}
   			},
   			methods : {
   				openToFrame : function(event){
   					var url = event.srcElement.getAttribute("data-href");
   					console.log(url);
   					this.iframeUrl = url;
   				},
   				v_init : function(){
   					if(this.menuTemp != null && this.menuTemp.length>0){
   						this.menuData = this.menuTemp;
   					}
   				},
   				show : function(){
   					console.log(this.menuTemp);
   				}
   			}
   		});
   		_vm.v_init();
    </script>
     <!-- 自定义js -->
  <%--   <script src="${pageContext.request.contextPath}/static/js/hAdmin.js?v=4.1.0"></script>
    <!-- 
     -->
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/index.js"></script> --%>
</body>
</html>